#!/bin/bash

export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:/home/c.hetherington/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:/Users/carl/Environments/dcpomatic/64/lib
if [ "$1" == "--debug" ]; then
    shift
    gdb --args build/src/tools/dcpomatic2 $*
elif [ "$1" == "--valgrind" ]; then
    shift
    valgrind --tool="memcheck" --suppressions=suppressions --track-fds=yes --show-leak-kinds=all --leak-check=full build/src/tools/dcpomatic2 $*
elif [ "$1" == "--callgrind" ]; then
    shift
    valgrind --tool="callgrind" build/src/tools/dcpomatic2 $*
elif [ "$1" == "--massif" ]; then
    shift
    valgrind --tool="massif" build/src/tools/dcpomatic2 $*
elif [ "$1" == "--i18n" ]; then
    shift
    LANGUAGE=de_DE.UTF8 LANG=de_DE.UTF8 LC_ALL=de_DE.UTF8 build/src/tools/dcpomatic2 "$*"
elif [ "$1" == "--perf" ]; then
    shift
    perf record build/src/tools/dcpomatic2 $*
elif [ "$1" == "--scaled" ]; then
    shift
    ~/src/run_scaled/run_scaled --sleep=5 --scale=0.5 build/src/tools/dcpomatic2 $*
else
    build/src/tools/dcpomatic2 $*
fi
